#ifndef CONTROLLER_HEADER_VIZMF_PROJECT
#define CONTROLLER_HEADER_VIZMF_PROJECT

#include "src/core/logger/logger.h"
#include "src/core/generic/translator.h"
#include "src/core/generic/parser.h"
#include "src/core/scene/moleculedrawer.h"
#include "src/core/scene/fielddrawer.h"
#include "src/gui/view.h"
#include "src/core/mvc/model.h"

class Controller
{
public:
  typedef std::string string;

  Controller()
  {
  }
  void setView(View* widget) { view = widget; }
  void setModel(Model* pmodel) { model = pmodel; }

  void addLogEntry(const LoggerRecord& record)
  {
    logger.addRecord(record);
    view->newLogEntry(record);
  }
  void setLoggerMark() { logger.setMark(); }
  void warnUser() { view->warnUser(logger.warnMessages()); }

  void newSession();
  int newDocument();
  void open(const string& filename);
  void removeWorkspace(const int wspId);
  void save(const int wspId);
  void saveAll();
  void importStructure();
  void importLattice();
  void importField();
  void importStyle();
  void importSurface();
  void exportStructure();
  void exportLattice();
  void exportField();
  void exportStyle();
  void exportSurface();
  void exportImage();
  void close(const int wspId);
  void exit() {}
  void redo();
  void undo();
  void remove();
  void cut();
  void copy();
  void paste();
  void insertArrow();
  void insertLine();
  void insertLabel();
  void insertText();
  void translate();
  void rotate();
  void scale();
  void setCpk();
  void setBS();
  void setWireframe();
  void showItems(); // show() and hide() controls the window visibility
  void hideItems();
  void selectAll();
  void unselectAll();
  void selectNearest();
  void invertSelection();
  void selectionBehaviourChanged();
  void generateSurfaceConnoly();
  void generateLatticeConnoly();
  void generateFieldCharges();
  void interpolateFieldLinear();
  void interpolateFieldCubicSplines();
  void compareFields();
  void compareStructuresSyncRotation();
  void compareStructuresOneWindow();
  void runScript();
  void loggingStart();
  void loggingStop();
  void loggingPause();
  void generateScript();
  void stopProcess();

  void updateWorkspaceGraphics(int wspId);
private:
  // shulga: let variables have _ at the end. E.g. logger -> logger_
  Logger logger;
  View *view;
  Model *model;
};

#endif // CONTROLLER_HEADER_VIZMF_PROJECT
